package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * The persistent class for the question database table.
 */
@Entity
@Table(name = "question")
@NamedQueries({
        @NamedQuery(name = "Question.findAll", query = "SELECT q FROM Question q"),
        @NamedQuery(name = "Question.findById", query = "SELECT q FROM Question q WHERE q.id = :id")})
public class Question implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Lob()
    @Column(nullable = false)
    private String question;

    // bi-directional many-to-one association to InterviewStatus
    @ManyToOne
    @JoinColumn(name = "id_interview_status", nullable = false)
    private InterviewStatus interviewStatus;

    // bi-directional many-to-one association to Position
    @ManyToOne
    @JoinColumn(name = "id_position", nullable = false)
    private Position position;

    // bi-directional many-to-one association to QuestionHistory
    @OneToMany(mappedBy = "question")
    private List<QuestionHistory> questionHistories;

    public Question() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getQuestion() {
        return this.question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public InterviewStatus getInterviewStatus() {
        return this.interviewStatus;
    }

    public void setInterviewStatus(InterviewStatus interviewStatus) {
        this.interviewStatus = interviewStatus;
    }

    public Position getPosition() {
        return this.position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public List<QuestionHistory> getQuestionHistories() {
        return this.questionHistories;
    }

    public void setQuestionHistories(List<QuestionHistory> questionHistories) {
        this.questionHistories = questionHistories;
    }

}